Crate uniffi

source ·

Modules

Macros

Assert that the uniffi runtime version matches an expected value.
A helper macro to include generated component scaffolding.

Structs

Support for reading a slice of foreign-language-allocated bytes over the FFI.
Struct to hold a foreign callback.
Support for passing an allocated-by-Rust buffer of bytes over the FFI.
Represents the success/error of a rust call
Used when internal/unexpected error happened when calling a foreign callback, for example when a unknown exception is raised

Constants

The method index used by the Drop trait to communicate to the foreign language side that Rust has finished with it, and it can be deleted from the handle map.

Traits

Trait defining how to transfer values via the FFI layer.
A helper trait to implement lowering/lifting using a RustBuffer

Functions

Wrap a rust function call and return the result directly
Wrap a rust function call that returns a Result<_, RustBuffer>
Check whether the uniffi runtime version is compatible a given uniffi_bindgen version.
A helper function to ensure we don’t read past the end of a buffer.
This helper allocates a new byte buffer owned by the Rust code, and returns it to the foreign-language code as a RustBuffer struct. Callers must eventually free the resulting buffer, either by explicitly calling uniffi_rustbuffer_free defined below, or by passing ownership of the buffer back into Rust code.
Free a byte buffer that had previously been passed to the foreign language code.
This helper copies bytes owned by the foreign-language code into a new byte buffer owned by the Rust code, and returns it as a RustBuffer struct. Callers must eventually free the resulting buffer, either by explicitly calling the destructor defined below, or by passing ownership of the buffer back into Rust code.
Reserve additional capacity in a byte buffer that had previously been passed to the foreign language code.

Type Definitions

ForeignCallback is the Rust representation of a foreign language function. It is the basis for all callbacks interfaces. It is registered exactly once per callback interface, at library start up time. Calling this method is only done by generated objects which mirror callback interfaces objects in the foreign language.
Result<T, Error>

Attribute Macros

Derive Macros